<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="bootstrap-3.3.5\dist\css\bootstrap.css">
    <script type="text/javascript">
        function del(id) {
           $.ajax({
               url:"del.do",
               data:{"id":id},
               dataType:"json",
               type:"post",
               success:function (i) {
                 if(i>0){
                    alert("删除成功");
                    location="list.do";
                 }
               }
           })
        }
        function fenye(cpage) {
            $("[name='cpage']").val(cpage);
            $("form").submit();
        }
    </script>
</head>
<body>

<table class="table">
<tr>
    <td>编号</td>
    <td>姓名</td>
    <td>城市</td>
    <td>公司</td>
    <td>行业</td>
    <td>日期</td>
    <td>
        <input type="button" value="删除" onclick="del()">
    </td>
</tr>
    <c:forEach items="${list}" var="s">
        <tr>
            <td>${s.id}</td>
            <td>${s.name}</td>
            <td>${s.to}</td>
            <td>${s.company}</td>
            <td>${s.object}</td>
            <td>${s.time}</td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="11">
        <td><input type="button" onclick="fenye(${pi.isFirstPage:pi.pages})"></td>
        </td>
    </tr>
</table>
</body>
</html>